package deepr.core;

import org.springframework.util.Assert;

import java.util.HashMap;

public class SchemaManager {

    public static HashMap<Class<?>, SchemaData> schemaStore = new HashMap<>();

    public static HashMap<String, SchemaData> objectStore = new HashMap<>();

    public static SchemaData getSchemaData(String object) {
        SchemaData schemaData = objectStore.get(object);
        Assert.isTrue(schemaData != null, object + " not exists");
        return schemaData;
    }

    public static SchemaData getSchemaData(Class<?> czz) {
        SchemaData schemaData = schemaStore.get(czz);
        Assert.isTrue(schemaData != null, czz + " not exists");
        return schemaData;
    }

}
